package com.dingreading.cloud.web.service.impl;

import com.dingreading.cloud.web.entity.table.ReadingStoreTableDef;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.dingreading.cloud.web.entity.ReadingStore;
import com.dingreading.cloud.web.mapper.ReadingStoreMapper;
import com.dingreading.cloud.web.service.ReadingStoreService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *  服务层实现。
 *
 * @author Administrator
 * @since 2024-11-14
 */
@Service
public class ReadingStoreServiceImpl extends BaseServiceImpl<ReadingStoreMapper, ReadingStore, ReadingStoreTableDef> implements ReadingStoreService {

    @Override
    protected ReadingStoreTableDef getTable() {
        return ReadingStoreTableDef.readingStore;
    }

    @Resource
    private ReadingStoreMapper readingStoreMapper;

    @Override
    public List<ReadingStore> getByIdsOrderByUidDesc(String storeUid) {
        return readingStoreMapper.getByIdsOrderByUidDesc(storeUid);
    }

    @Override
    public ReadingStore getByUid(String storeUid) {
        return getMapper().selectOneByCondition(table.storeUid.eq(storeUid));
    }

}
